<template>
  <article>
    <TableBody>
      <template #header>
        <TableHeader>
          <template #table-config>
            <a-button>新增</a-button>
          </template>
        </TableHeader>
      </template>
      <template #default>
        <a-table :columns="columns" />
      </template>
    </TableBody>
  </article>
</template>
<script setup lang="ts">
  import usePost from '@/hooks/usePost'
  import { USER_LIST } from '@/api/user'

  const post = usePost()

  const columns = [
    {
      title: 'Name',
      dataIndex: 'name',
    },
    {
      title: 'Salary',
      dataIndex: 'salary',
    },
    {
      title: 'Address',
      dataIndex: 'address',
    },
    {
      title: 'Email',
      dataIndex: 'email',
    },
  ]

  const init = async () => {
    const {} = await post({
      url: USER_LIST,
    })
  }

  onMounted(init)
</script>
